From: Stuart Prescott <stuart@debian.org>
-Date: Tue, 7 May 2024 10:06:59 +1000
+Date: Thu, 9 Jan 2025 15:45:36 +1100
Subject: Fix numpy header detection
Existing code makes assumptions about site-packages/dist-packages
and fails to find the headers; numpy has an explicit function for this
---
- build_scripts/utils.py | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
+ build_scripts/utils.py | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
-index 74d9e6f..8121c8d 100644
+index 311c67f..8121c8d 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
-@@ -67,12 +67,8 @@ def update_env_path(newpaths):
+@@ -67,17 +67,8 @@ def update_env_path(newpaths):
def get_numpy_location():
- if 'site-' in p:
- numpy = Path(p).resolve() / 'numpy'
- if numpy.is_dir():
-- return os.fspath(numpy / 'core' / 'include')
+- candidate = numpy / '_core' / 'include' # Version 2
+- if not candidate.is_dir():
+- candidate = numpy / 'core' / 'include' # Version 1
+- if candidate.is_dir():
+- return os.fspath(candidate)
+- log.warning(f"Cannot find numpy include dir under {numpy}")
- return None
+ import numpy
+ return numpy.get_include()
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/build_scripts/config.py b/build_scripts/config.py
-index 0a6eebf..d049a24 100644
+index 5a2f665..e7f4ae4 100644
--- a/build_scripts/config.py
+++ b/build_scripts/config.py
@@ -65,6 +65,7 @@ class Config(object):